package org.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "comments")
public class Comments {
    /**
     * 评论唯一标识，自增主键
     */
    @TableId(value = "comment_id", type = IdType.INPUT)
    private Integer commentId;

    /**
     * 评论作者的用户ID，外键关联用户表
     */
    @TableField(value = "comment_user_id")
    private Integer commentUserId;

    /**
     * 评论绑定的目标ID，外键关联目标的表
     */
    @TableField(value = "target_id")
    private Integer targetId;

    /**
     * 评论内容，支持长文本存储
     */
    @TableField(value = "content")
    private String content;

    /**
     * 评论创建时间，默认当前时间
     */
    @TableField(value = "created_at")
    private Date createdAt;

    /**
     * 点赞数
     */
    @TableField(value = "commentAndLike")
    private Integer commentandlike;
    @TableField(exist = false)
    private List<User> userList;
    @TableField(exist = false)
    private User user;
    @TableField(exist = false)
    private Employee employee;
}